import json
from log.logger import Logger


def saveLog(message, level='info'):
    model = Logger(level)
    logMsg = json.loads(message)
    getattr(model, level)(message)
    if not logMsg['result']['not_format_content']:
        model.error('原文为空 ' + message)
    if not logMsg['result']['content']:
        model.error('过滤后的文章为空 ' + message)
